package com.pjc.config;

/**
 * API请求类型(枚举)
 * 
 * @author 王畅
 * @version 创建时间：2015-6-16 上午09:09:25
 */
public enum RequestType {

	API_REG_USER(1, "用户注册"), 
	API_LOGIN(2, "用户登录"), 
	API_GETUSERINFO(3, "获取用户信息");

	private int type;
	private String desc;

	private RequestType(int type, String desc) {
		this.desc = desc;
		this.type = type;
	}

	public static RequestType getEnumByType(int type) {
		for (RequestType vo : values()) {
			if (vo.getType() == type) {
				return vo;
			}
		}
		return null;
	}

	public int getType() {
		return this.type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public String getDesc() {
		return this.desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
}
